/*
 * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include <gtest/gtest.h>
#include "sle_seek_impl.h"
#include "cmd_input.h"
#include <vector>
#include <memory>
#include <cstring>
#include <iterator>

namespace OHOS {
namespace NearLink {
namespace SleStandard {
using namespace testing::ext;

// 全局变量
static SleSeek *g_SleSeek = nullptr;

// 测试类定义
class SeekHandlerTest : public testing::Test {
public:
    static void SetUpTestCase() {
        // 初始化全局变量或资源
        g_SleSeek = &SleSeek::GetDefaultSeek();
    }
    static void TearDownTestCase() {
        // 清理全局变量或资源
        g_SleSeek = nullptr;
    }
    void SetUp() override {
       
    }
    void TearDown() override {
      
    }
};

// 测试用例：开始搜索 - 正常情况
HWTEST_F(SeekHandlerTest, StartSeekTest001, TestSize.Level1) {
    SleSeekParam param = {
        .addrType = SLE_PUBLIC_ADDRESS_TYPE,
        .repateFilter = DEFAULT_SLE_SEEK_REPATE_FILTER,
        .filterPolicy = DEFAULT_SLE_SEEK_FILTER_POLICY,
        .phys = DEFAULT_SLE_SEEK_PHYS,
        .type[0] = DEFAULT_SLE_SEEK_TYPE,
        .interval[0] = DEFAULT_SLE_SEEK_INTERVAL,
        .window[0] = DEFAULT_SLE_SEEK_WINDOW,
    };

    SleErrorCode ret = g_SleSeek->StartSeek(param);
    EXPECT_EQ(ret, SLE_ERR_CHECKOUT_FAILED); 
}

// 测试用例：停止搜索 - 正常情况
HWTEST_F(SeekHandlerTest, StopSeekTest001, TestSize.Level1) {
    SleErrorCode ret = g_SleSeek->StopSeek();
    EXPECT_EQ(ret, SLE_ERR_CHECKOUT_FAILED); 
}

} // namespace SleStandard
} // namespace NearLink
} // namespace OHOS